package com.xiashitech.agent.instrumentation.struts2.inst;

import com.google.auto.service.AutoService;
import io.opentelemetry.javaagent.extension.instrumentation.InstrumentationModule;
import io.opentelemetry.javaagent.extension.instrumentation.TypeInstrumentation;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import static java.util.Arrays.asList;

@AutoService(InstrumentationModule.class)
public class XSStruts2ActionInstrumentationModule extends InstrumentationModule {
    public XSStruts2ActionInstrumentationModule() {
        super("struts2-action");
    }
    @Override
    public List<TypeInstrumentation> typeInstrumentations() {
        return asList(new XSStruts2ProxyExecuteInstrumentation(), new XSStruts2PackageInstrumnentation());
    }
    @Override
    public List<String> getAdditionalHelperClassNames() {
        List<String> helperClassNames = new ArrayList();
        helperClassNames.addAll(Arrays.asList("com.xiashitech.agent.instrumentation.struts2.XSStruts2ActionAttributesExtractor",
                "com.xiashitech.agent.instrumentation.struts2.XSStruts2ActionSingletons",
                "com.xiashitech.agent.instrumentation.struts2.api.inst.XSStruts2AllApiDeal",
                "com.xiashitech.agent.instrumentation.spring.controller.apicapture.inst.utils.GenerateSpanAttrUtil",
                "com.xiashitech.agent.instrumentation.spring.controller.apicapture.inst.ApiGenerate"));
        return helperClassNames;
    }
}
